package com.webull.information.center.carwler.common.util.news;

import org.apache.commons.lang3.StringUtils;

/**
 * 网站匹配规则
 * 
 * @author shimingjun
 * @date 2016年8月29日 下午12:23:50
 * @version 1.0
 * @since JDK 1.8
 */

public class NewsPredicate {

	public static boolean testSinaTw(String host) {
		return "news.sina.com.tw".equalsIgnoreCase(host);
	}

	public static boolean testSinaFinance(String host) {
		return host != null && host.matches("(?i).{0,}.sina(\\.com){0,}.cn") && !StringUtils.contains(host, "tech");
	}

	public static boolean testSinaTech(String host) {
		return host != null && host.matches("(?i).{0,}tech.sina(\\.com){0,}.cn");
	}

	public static boolean testNewEase(String host) {
		return host != null && host.matches("(?i).{1,}.163.com");
	}

	public static boolean testSohu(String host) {
		return host != null && host.matches("(?i).{1,}.sohu.com");
	}

	public static boolean testReuters(String host) {
		return host != null && host.matches("(?i).{0,}reuters.com");
	}

	public static boolean testScmp(String host) {
		return host != null && host.matches("(?i).{0,}scmp.com$");
	}

	public static boolean testBloomberg(String host) {
		return "bloomberg.com".equalsIgnoreCase(host);
	}

	public static boolean testBusinesswire(String host) {
		return "businesswire.com".equalsIgnoreCase(host);
	}

	public static boolean testPrnewswire(String host) {
		return "prnewswire.com".equalsIgnoreCase(host);
	}

	public static boolean testR1Caiwire(String host) {
		return "21jingji.com".equalsIgnoreCase(host);
	}

}
